#ifndef __CACHECENTRAL_H__
#define __CACHECENTRAL_H__

#include "cacheCommon.h"
#include "qSingleton.h"

class centralCache : public qSingleton<centralCache> 
{
    friend qSingleton<centralCache>;
public:
    qSpan* GetOneSpan(size_t idx, size_t size_class);
    size_t fetchRangeObj(void*& start, void*& end, size_t num, size_t idx);
    void releaseRangeObj(void* start, size_t size_class);
protected:
    centralCache() = default;
    centralCache(const centralCache& c) {}
    centralCache& operator=(const centralCache& c){}

private:
    spanList span_list_[FREELISTNUM];
};

#endif